package cn.cmb;

public class TestMain {

	public static void main(String[] args) {
	  char[] a ="ABCD".toCharArray();
	  boolean[] color=new boolean[a.length];
	  fun(a,2,color,0);	
	}
	public static void fun(char[] a,int num,boolean[] color,int start){
		if(num==0){
			for(int i=0;i<start;i++){
				if(color[i]){System.out.print(a[i]+" ");}
			}
			System.out.println();return;
		}
		if(start==a.length){ return;}
		color[start]=true;
		 fun(a,num-1,color,start+1);
		color[start]=false;
		 fun(a,num,color,start+1);
	}
}
